package com.ruoyi.pv.domain.vo;

import cn.hutool.json.JSONUtil;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.pv.domain.PvUserInfo;
import lombok.*;


/**
 * 学员报名记录对象 pv_student_record
 *
 * @author zzx
 * @date 2023-04-20
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
public class PvStudentRecordExcelVo {
    private static final long serialVersionUID = 1L;
    
    /**
     * 学生编号
     */
    @Excel(name = "账号") private String loginName;
    @Excel(name = "姓名") private String userName;
    @Excel(name = "联系方式") private String phone;
    @Excel(name = "上岗证") private String postsNumber;

    /**
     * 工作单位
     */
    @Excel(name = "工作单位") private String workUnit;
    /**
     * 社区
     */
    @Excel(name = "社区") private String community;
    /**
     * 执业范围
     */
    @Excel(name = "执业范围") private String practiceRange;
    /**
     * 执业类别
     */
    @Excel(name = "执业类别") private String practiceType;
    /**
     * 所在科室/岗位
     */
    @Excel(name = "所在科室/岗位") private String posts;
    /**
     * 参加初训年份
     */
    @Excel(name = "参加初训年份") private String initialTraining;
    /**
     * 证书编号
     */
    @Excel(name = "证书编号") private String certName;

//    @Excel(name = "班级") private String trainingName;

    /**
     * 评分表
     */
    @Excel(name = "考试分数")private Double exScore;
    @Excel(name = "幼儿分数")private Integer childrenTotalPoints;
    @Excel(name = "产妇分数")private Integer puerperaTotalPoints;
    @Excel(name = "评分表总分")private Integer tableTotal;

    /**
     * 备注
     */
    @Excel(name = "幼儿备注")private String childrenComment;
    @Excel(name = "产妇备注")private String puerperaComment;

    /**
     * 状态
     */
    @Excel(name = "状态",dictType = "pv_study_record_status") private Integer status;
    
    public PvStudentRecordExcelVo setUserInfo(Object obj){
        PvUserInfo userInfo = JSONUtil.parseObj(obj).toBean(PvUserInfo.class);
        this.workUnit = userInfo.getWorkUnit();
        this.community = userInfo.getCommunity();
        this.practiceRange = userInfo.getPracticeRange();
        this.practiceType = userInfo.getPracticeType();
        this.posts = userInfo.getPosts();
        this.initialTraining = userInfo.getInitialTraining();
        return this;
    }
}
